package com.xms.schema.api.controller;


import com.xms.schema.service.stringmap.IStringMapFinderService;
import com.xms.web.framework.controller.ApiBaseController;
import com.xms.web.framework.model.JsonResultObject;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author migo
 * @since 2021-08-27
 */
@RestController
@RequestMapping("/{org}/api/schema/stringmap")
public class StringMapFinderController extends ApiBaseController {
    private IStringMapFinderService _stringMapFinderService;
    @Autowired
    public StringMapFinderController(IStringMapFinderService stringMapFinderService){
        _stringMapFinderService = stringMapFinderService;
    }

    @ApiOperation("查询字段选项")
    @RequestMapping(value = "{attributeid}", method = RequestMethod.GET)
    public JsonResultObject get(@PathVariable(value="attributeid", required = true) UUID attributeId)
    {
        return JOk(_stringMapFinderService.getByAttributeid(attributeId));
    }
}
